package org.baicaix.game.warworms.worm {
	import org.baicaix.game.warworms.weapon.Weapon;

	import flash.display.Sprite;

	/**
	 * 1 移动
	 * 2 跳
	 * @author baicaix
	 */
	public class Worm extends Sprite {
		
		private var _name : String;
		private var _health : int;
		
		public var _vx : Number;
		public var _vy : Number;
		
		private var _weapon : Weapon;

		public function Worm(name : String, health : int = 100) {
			_name = name;
			_health = health;
			
			_weapon = addChild(new Weapon()) as Weapon;
		}
		
		public function jump() : void {
			_vy += 10;
		}
		
		public function move() : void {
			
		}
		
		public function get wormName() : String {
			return _name;
		}
		
		public function get health() : int {
			return _health;
		}

		public function get weapon() : Weapon {
			return _weapon;
		}
		
		public function set weapon(weapon : Weapon) : void {
			_weapon = weapon;
		}

		public function hurt(num : uint) : int {
			 _health -= num;
			return _health;
		}
		
		public function heal(num : uint) : int {
			 _health += num;
			return _health;
		}
		
		
	}
}
